import { createId } from "../create-id";

export const createWorkspaceId = () => {
  const workspaceId = createId({ prefix: "ws_" });

  // guard against collisions with old workspace ID format
  if (workspaceId.toLowerCase().startsWith("ws_c")) {
    return createWorkspaceId();
  }

  return workspaceId;
};
